package main

import (
	"flag"
	"fmt"
	"google.golang.org/grpc"
	"log"
	"net"
	"pay/internal/server"
	pb "pay/proto"
	_ "stock/initialization"
)

var (
	port = flag.Int("pay", 50054, "The server port")
)

func main() {
	flag.Parse()
	lis, _ := net.Listen("tcp", fmt.Sprintf(":%v", *port))
	s := grpc.NewServer()
	pb.RegisterPayServer(s, &server.Server{})
	log.Printf("server listening at %v", lis.Addr())
	if err := s.Serve(lis); err != nil {
		log.Printf("server listening at %v", lis.Addr())
	}
}
